/*
 * Form elements
 */


option {
    font-weight: 400;
}

::-webkit-input-placeholder {
    color: var(--text-primary-color);
}

input[type="text"],
input[type="url"],
input[type="tel"],
input[type="number"],
input[type="email"],
input[type="search"],
input[type="password"],
input[type="colorpicker"],
.small-image-upload,
select {
    background-color: var(--input-bg);
    border: none;
    border-radius: var(--border-radius);
    box-shadow: inset 0 0 0 1px var(--input-border-color);
    color: var(--text-primary-color);
    font: 400 #{$app-font-base}/1.5 var(--font-base);
    outline: none;
    padding: 1.2rem 1.8rem;

    &:focus {
        box-shadow: inset 0 0 2px 1px var(--input-border-focus);
    }

    &[disabled],
    &[readonly] {
        opacity: .5;
        cursor: not-allowed;

        &:focus {
            box-shadow: inset 0 0 0 1px var(--input-border-color);
        }
    }
}

input[type="colorpicker"][readonly] {
    opacity: 1;
    cursor: auto;
}

input[type="search"] {
    -webkit-appearance: none;
}

input[type="file"] {
    margin-bottom: 1rem;
    width: 100%;
}

input {
    &.invalid {
        border: 1px solid var(--warning);

        &:focus {
            border: none;
        }
    }
}

/* disabled input */
input:disabled {
    opacity: .6;
}

input:disabled + label {
    opacity: .6;
    cursor:default;
    -webkit-user-select: none;
}

/* Range */
input[type="range"] {
    -webkit-appearance: none;
    background: transparent;
    float: left;
    margin: 1rem 0;
    position: relative;
    top: 1.6rem;
    width: 80%!important;

    & + span {
        float: right;
        position: relative;
        text-align: center;
        top: 1.6rem;
        width: 20%!important;
    }

    &::-webkit-slider-thumb {
        -webkit-appearance: none;
        background: var(--color-primary);
        border: none;
        border-radius: 50%;
        box-shadow: 1px 1px 1px rgba(0, 0, 0, .15);
        cursor: pointer;
        height: 2rem;
        margin-top: -1rem;
        outline: none;
        width: 2rem;
    }

    &::-webkit-slider-runnable-track {
        background: $color-8;
        border: none;
        cursor: pointer;
        height: 2px;
        outline: none;
        width: 80%;
    }

    &:focus::-webkit-slider-runnable-track {
        background: rgba($color-1, .5);
        outline: none;
    }
}


/*
 * Password field UI
 */
.password-wrapper {
    position: relative;

    & > a {
        font-size: 1.4rem;
        position: absolute;
        right: 2rem;
        top: 1.4rem;
        z-index: 1;
    }
}

.custom-password-wrapper {
    position: relative;

    & > a {
        font-size: 1.4rem;
        position: absolute;
        right: 2rem;
        top: 73%;
        transform: translateY(-50%);
        z-index: 1;
    }
}

/* Fix for the colorpicker */
.colorpicker input {
    box-shadow: none;
    font: 400 1.2rem/1.5 var(--font-base);
    padding: 2px;
}

/*
 * Small image uploader
 */
.small-upload-image {
    min-height: 48px;
    position: relative;

    .small-upload-remove {
        background: var(--warning);
        border-radius: 1.2rem;
        color: transparent;
        font-size: 1rem;
        font-weight: var(--font-weight-semibold);
        height: 2rem;
        line-height: 1rem;
        padding: 0;
        position: absolute;
        right: 1.5rem;
        text-align: center;
        text-indent: 1px;
        top: 1.4rem;
        width: 2rem;

        &:before,
        &:after {
           background: var(--bg-primary);
            content: "";
            display: block;
            height: .2rem;
            left: 4px;
            position: absolute;
            top: 9px;
            transform: rotate(45deg);
            width: 1.2rem;
        }

        &:after {
            transform: rotate(-45deg);
        }

        &:hover {
            opacity: .75;
        }
    }

    .small-upload-image-input {
        display: block;
        position: absolute;
        right: .7rem;
        top: .7rem;
        width: 16rem!important; 

        &::-webkit-file-upload-button {
            -webkit-appearance: none;
            background: var(--button-secondary-bg);
            border: 1px solid var(--button-secondary-bg);
            border-radius: var(--border-radius);
            color: var(--button-secondary-color);
            cursor: pointer;
            font-weight: var(--font-weight-semibold);
            font-size: 1.4rem;
            padding: .5rem;
            text-align: center;
            width: 16rem;
            outline: none;

            &:hover {
                background: var(--button-secondary-bg-hover);
                border-color: var(--button-secondary-bg-hover);
                color: var(--button-secondary-color-hover);
            }
        }
    }
}

/**
 * Multiselect
 */

.multiselect__tags {
    min-height: 47px;
    padding: 0 4rem 0 1.8rem;
}

.multiselect__option--highlight {
    background: var(--input-bg-light);
    color: var(--text-primary-color);
}

.multiselect__input,
.multiselect__single {
    height: 47px;
    line-height: 47px;
}

.multiselect__placeholder {
    color: var(--text-primary-color);
    font-size: $app-font-base;
    height: inherit;
    line-height: 47px;
    margin: 0;
    padding: 0;
}
